cargo.git
9 years agofix more tests with regex
Aleksey Kladov [Sun, 15 May 2016 21:17:56 +0000 (00:17 +0300)]
fix more tests with regex

9 years agofix test_cargo_test
Aleksey Kladov [Sun, 15 May 2016 21:07:04 +0000 (00:07 +0300)]
fix test_cargo_test

9 years agofix some tests with IntelliJ-Rust automated refactoring
Aleksey Kladov [Sun, 15 May 2016 01:11:00 +0000 (04:11 +0300)]
fix some tests with IntelliJ-Rust automated refactoring

9 years agofix some more tests with regexp
Aleksey Kladov [Sat, 14 May 2016 21:44:18 +0000 (00:44 +0300)]
fix some more tests with regexp

9 years agofix a bunch of tests with regexp
Aleksey Kladov [Sat, 14 May 2016 21:15:22 +0000 (00:15 +0300)]
fix a bunch of tests with regexp

9 years agofix test_cargo_clean
Aleksey Kladov [Sat, 14 May 2016 21:00:00 +0000 (00:00 +0300)]
fix test_cargo_clean

9 years agofix test_cargo_build_lib
Aleksey Kladov [Sat, 14 May 2016 20:53:49 +0000 (23:53 +0300)]
fix test_cargo_build_lib

9 years agofix test_cargo_build_auth
Aleksey Kladov [Sat, 14 May 2016 20:49:39 +0000 (23:49 +0300)]
fix test_cargo_build_auth

9 years agoreport status to stderr instead of stdout
Aleksey Kladov [Sat, 14 May 2016 20:31:11 +0000 (23:31 +0300)]
report status to stderr instead of stdout

9 years agoAuto merge of #2703 - alexcrichton:target-dir-abs-path, r=alexcrichton
bors [Wed, 18 May 2016 18:18:39 +0000 (11:18 -0700)]
Auto merge of #2703 - alexcrichton:target-dir-abs-path, r=alexcrichton

Fix relative `build.target-dir` configuration

Closes #2700

9 years agoAuto merge of #2706 - alx741:extend_manpages, r=alexcrichton
bors [Wed, 18 May 2016 17:08:25 +0000 (10:08 -0700)]
Auto merge of #2706 - alx741:extend_manpages, r=alexcrichton

Add man pages for cargo commands

So, the markdown port (#2672) is in idle, I'll be working in a way to make it without depending on external tools, but that is going to take a bit longer.

These are the **troff** pages for the rest of the cargo commands; previously the *cargo-build(1)* was added, so here are the rest.

No extra build dependencies here, just the new man pages.

9 years agoAuto merge of #2688 - carols10cents:docs-refresh, r=alexcrichton
bors [Wed, 18 May 2016 03:54:03 +0000 (20:54 -0700)]
Auto merge of #2688 - carols10cents:docs-refresh, r=alexcrichton

Docs refresh

Hi! Sooooo I've been thinking about the cargo docs lately and today I decided to try some of the things I've been thinking about.

There are some smaller changes in here, typos and clarifications and stuff, that I'm totally willing to break out into a separate PR(s) if yinz want.

My goals for the larger changes were:

- **Make one obvious place to go for info on every which way to specify a dependency.** I've found myself clicking around the different doc pages a lot to find the semver syntax, the different keys that can go with a git location, the `path` override syntax, etc. So I made one top-level "Specifying Dependencies" page and moved relevant info from the guide, the manifest page, and the crates.io page.
- **Make The Guide a bit more focused.** There were a few topics in there that didn't really fit in the story arc of trying to get someone up and running with cargo-- it veered off into some more advanced topics that I've moved to places I think they fit better.
- **Make the crates.io page only about publishing, not using and publishing.** The info about adding dependencies got folded into either the guide or the new specifying dependencies page, so this should close https://github.com/rust-lang/cargo/issues/1035.

I'm also thinking about having someone new to rust/cargo try following the guide, but wanted to get a first pass from experienced people :)

9 years agoAuto merge of #2713 - sbeckeriv:fix-name-ordering, r=alexcrichton
bors [Wed, 18 May 2016 02:09:43 +0000 (19:09 -0700)]
Auto merge of #2713 - sbeckeriv:fix-name-ordering, r=alexcrichton

Correct author order

Dearest Reviewer,

PR #2696 added some new checks for environment variables for author and
email. After the pull request was merged a comment was left about gits
ordering for looking at the variables. This pull request closes #2705 by
reordering the look up and also addeds CARGO_NAME and CARGO_EMAIL to the
top of the order.

Thanks
Becker

9 years agoCorrect author order
Stephen Becker IV [Tue, 17 May 2016 23:31:42 +0000 (16:31 -0700)]
Correct author order

Dearest Reviewer,

PR #2696 added some new checks for environment variables for author and
email. After the pull request was merged a comment was left about gits
ordering for looking at the variables. This pull request closes #2705 by
reordering the look up and also addeds CARGO_NAME and CARGO_EMAIL to the
top of the order.

Thanks
Becker

9 years agoAt the end, point to docs that might be interesting next
Carol (Nichols || Goulding) [Tue, 17 May 2016 23:08:24 +0000 (19:08 -0400)]
At the end, point to docs that might be interesting next

9 years agoAdd info about what's different between debug/release
Carol (Nichols || Goulding) [Tue, 17 May 2016 22:48:35 +0000 (18:48 -0400)]
Add info about what's different between debug/release

9 years agoAdd info about `build-dependencies` to the specifying deps page
Carol (Nichols || Goulding) [Tue, 17 May 2016 22:41:31 +0000 (18:41 -0400)]
Add info about `build-dependencies` to the specifying deps page

9 years agoAdd a `[dev-dependencies]` example
Carol (Nichols || Goulding) [Tue, 17 May 2016 22:33:27 +0000 (18:33 -0400)]
Add a `[dev-dependencies]` example

9 years agoCorrect typo when referring to 64 bit
Carol (Nichols || Goulding) [Tue, 17 May 2016 22:33:13 +0000 (18:33 -0400)]
Correct typo when referring to 64 bit

9 years agoAuto merge of #2707 - sbeckeriv:banned-list-2699, r=alexcrichton
bors [Tue, 17 May 2016 19:48:52 +0000 (12:48 -0700)]
Auto merge of #2707 - sbeckeriv:banned-list-2699, r=alexcrichton

Ban keywords from crate names

Dearest Reviewer,

This pull request extends the banned list of project names to include
all of the current keywords for rust. I got the list of keywords from
https://doc.rust-lang.org/grammar.html#keywords . This
closes #2699 . The original ticket said warn but I figured how test is
handled is most likely how all banned names should be handled.

Oddly enough a few keywords have made their way to the crates.io. fn and
proc are both examples I found spot checking keywords. I do not there is
any action to take on those crates.

Thanks
Becker

9 years agoBan keywords from crate names
Stephen Becker IV [Tue, 17 May 2016 05:37:05 +0000 (22:37 -0700)]
Ban keywords from crate names

Dearest Reviewer,

This pull request extends the banned list of project names to include
all of the current keywords for rust. I got the list of keywords from
https://doc.rust-lang.org/grammar.html#keywords . This
closes #2699 . The original ticket said warn but I figured how test is
handled is most likely how all banned names should be handled.

Oddly enough a few keywords have made their way to the crates.io. fn and
proc are both examples I found spot checking keywords. I do not there is
any action to take on those crates.

Thanks
Becker

9 years agoAuto merge of #2685 - mkroman:master, r=alexcrichton
bors [Tue, 17 May 2016 16:00:28 +0000 (09:00 -0700)]
Auto merge of #2685 - mkroman:master, r=alexcrichton

Fix `cargo test --doc` not testing examples

When running cargo doc --test in a project folder, cargo does not test documentation examples, it only builds the project and exits.

Refer to issue #2684

9 years agoRevert "Maybe fix failing build on OS X rust beta"
Mikkel Kroman [Tue, 17 May 2016 13:08:29 +0000 (15:08 +0200)]
Revert "Maybe fix failing build on OS X rust beta"

This reverts commit 3fb3fdc82fdf3a1ea060d51076c86c71fe1f405b.

9 years agoMan pages: add cargo-search
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:53:30 +0000 (21:53 -0500)]
Man pages: add cargo-search

9 years agoMan pages: add cargo-publish
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:53:22 +0000 (21:53 -0500)]
Man pages: add cargo-publish

9 years agoMan pages: add cargo-package
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:53:03 +0000 (21:53 -0500)]
Man pages: add cargo-package

9 years agoMan pages: add cargo-update
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:52:54 +0000 (21:52 -0500)]
Man pages: add cargo-update

9 years agoMan pages: add cargo-install
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:52:40 +0000 (21:52 -0500)]
Man pages: add cargo-install

9 years agoMan pages: add cargo-bench
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:52:25 +0000 (21:52 -0500)]
Man pages: add cargo-bench

9 years agoMan pages: fix cargo-test
Daniel Campoverde [alx741] [Tue, 17 May 2016 02:52:13 +0000 (21:52 -0500)]
Man pages: fix cargo-test

9 years agoMaybe fix failing build on OS X rust beta
Mikkel Kroman [Tue, 17 May 2016 02:50:41 +0000 (04:50 +0200)]
Maybe fix failing build on OS X rust beta

9 years agoMan pages: add cargo-test
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:47:55 +0000 (20:47 -0500)]
Man pages: add cargo-test

9 years agoMan pages: remove options from cargo-run
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:47:37 +0000 (20:47 -0500)]
Man pages: remove options from cargo-run

9 years agoAdd cargo-init reference in cargo-new
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:34:04 +0000 (20:34 -0500)]
Add cargo-init reference in cargo-new

9 years agoMan pages: add cargo-run
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:33:55 +0000 (20:33 -0500)]
Man pages: add cargo-run

9 years agoMan pages: add cargo-init
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:33:43 +0000 (20:33 -0500)]
Man pages: add cargo-init

9 years agoMan pages: add cargo-new
Daniel Campoverde [alx741] [Tue, 17 May 2016 01:10:08 +0000 (20:10 -0500)]
Man pages: add cargo-new

9 years agoMan pages: add cargo-doc
Daniel Campoverde [alx741] [Tue, 17 May 2016 00:47:05 +0000 (19:47 -0500)]
Man pages: add cargo-doc

9 years agoMan pages: add cargo-clean
Daniel Campoverde [alx741] [Tue, 17 May 2016 00:35:02 +0000 (19:35 -0500)]
Man pages: add cargo-clean

9 years agoMan pages: Improve cargo-build description
Daniel Campoverde [alx741] [Tue, 17 May 2016 00:34:40 +0000 (19:34 -0500)]
Man pages: Improve cargo-build description

9 years agoAuto merge of #2696 - sbeckeriv:an-author-by-another-name-1213, r=alexcrichton
bors [Tue, 17 May 2016 00:11:58 +0000 (17:11 -0700)]
Auto merge of #2696 - sbeckeriv:an-author-by-another-name-1213, r=alexcrichton

An author by another name

Dearest Reviewer

This is to support environment variables for name and email more like
git. This closes #1213 . I did look in to using libgit2 but I did not
see a clear way to get the author ident. This just moves from or_else
chaining to map_filter with env checks and getting the nth(0) result.

The docs I found
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#Committing
do not really indicate an order of preference to the variables. I am
more then happy to rearrange the arrays in anyway.

I also did not add in a new test for the positive case because the
test for the current variables cover that path.

Thanks for reviewing,
Becker

9 years agoAn author by another name
Stephen Becker IV [Mon, 16 May 2016 05:44:30 +0000 (22:44 -0700)]
An author by another name

Dearest Reviewer

This is to support environment variables for name and email more like
git. This closes #1213 . I did look in to using libgit2 but I did not
see a clear way to get the author ident. This just moves from or_else
chaining to map_filter with env checks and getting the nth(0) result.

The docs I found
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#Committing
do not really indicate an order of preference to the variables. I am
more then happy to rearrange the arrays in anyway.

Thanks for reviewing,
Becker

9 years agoUse dedicated directory for man pages
Daniel Campoverde [alx741] [Mon, 16 May 2016 23:47:55 +0000 (18:47 -0500)]
Use dedicated directory for man pages

9 years agoAuto merge of #2701 - alexcrichton:target-no-dylib, r=brson
bors [Mon, 16 May 2016 20:29:00 +0000 (13:29 -0700)]
Auto merge of #2701 - alexcrichton:target-no-dylib, r=brson

Return a normal error if dylibs aren't supported

Rebasing of https://github.com/rust-lang/cargo/pull/2437 with a few comments addressed

Closes https://github.com/rust-lang/cargo/issues/2427

9 years agoAdd missing newline in test output
Mikkel Kroman [Mon, 16 May 2016 19:35:01 +0000 (21:35 +0200)]
Add missing newline in test output

9 years agoChange `cargo test --doc` test to match stdout
Mikkel Kroman [Mon, 16 May 2016 18:56:40 +0000 (20:56 +0200)]
Change `cargo test --doc` test to match stdout

9 years agoFix relative `build.target-dir` configuration
Alex Crichton [Mon, 16 May 2016 18:09:52 +0000 (11:09 -0700)]
Fix relative `build.target-dir` configuration

Closes #2700

9 years agoTouch up the error message and warnings
Alex Crichton [Mon, 16 May 2016 17:42:29 +0000 (10:42 -0700)]
Touch up the error message and warnings

9 years agoMerge branch 'issue-2427' of https://github.com/jespino/cargo into target-no-dylib
Alex Crichton [Mon, 16 May 2016 17:38:36 +0000 (10:38 -0700)]
Merge branch 'issue-2427' of https://github.com/jespino/cargo into target-no-dylib

9 years agoClarify statements about ignoring/checking in Cargo.lock
Carol (Nichols || Goulding) [Sun, 15 May 2016 14:39:40 +0000 (10:39 -0400)]
Clarify statements about ignoring/checking in Cargo.lock

9 years agoSmall rewordings
Carol (Nichols || Goulding) [Sun, 15 May 2016 14:30:40 +0000 (10:30 -0400)]
Small rewordings

9 years agoClarify that you should not manually edit Cargo.lock
Carol (Nichols || Goulding) [Sun, 15 May 2016 14:28:40 +0000 (10:28 -0400)]
Clarify that you should not manually edit Cargo.lock

9 years agoAdd an ascii directory tree to the project layout section
Carol (Nichols || Goulding) [Sun, 15 May 2016 14:27:40 +0000 (10:27 -0400)]
Add an ascii directory tree to the project layout section

9 years agoClarify that integration tests go in tests/
Carol (Nichols || Goulding) [Sun, 15 May 2016 14:19:13 +0000 (10:19 -0400)]
Clarify that integration tests go in tests/

"External" is a bit confusing. Then if we say where integration tests
go, that might make someone wonder where the unit tests go, so I added a
note about unit tests.

9 years agoAuto merge of #2691 - serprex:master, r=alexcrichton
bors [Sun, 15 May 2016 01:43:48 +0000 (18:43 -0700)]
Auto merge of #2691 - serprex:master, r=alexcrichton

Remove dependency on time in favor of std::time

9 years agoAuto merge of #2690 - hatsunearu:hatsunearu-patch-1, r=alexcrichton
bors [Sun, 15 May 2016 01:08:35 +0000 (18:08 -0700)]
Auto merge of #2690 - hatsunearu:hatsunearu-patch-1, r=alexcrichton

Update manpage with some missing cargo commands

the manpage of cargo is missing a few important cargo commands, and I've added `rustc` and `help`. Hopefully everything's alright.

9 years agoAuto merge of #2676 - srinivasreddy:refactor, r=alexcrichton
bors [Sun, 15 May 2016 00:29:02 +0000 (17:29 -0700)]
Auto merge of #2676 - srinivasreddy:refactor, r=alexcrichton

remove sleep_ms and change it to sleep

9 years agoReword note about git init default to be in the positive
Carol (Nichols || Goulding) [Sat, 14 May 2016 21:16:42 +0000 (17:16 -0400)]
Reword note about git init default to be in the positive

9 years agoRemove section about converting a project to cargo
Carol (Nichols || Goulding) [Sat, 14 May 2016 14:17:43 +0000 (10:17 -0400)]
Remove section about converting a project to cargo

Since most projects start with cargo these days.

9 years agoRemove dependency on time in favor of std::time
Demur Rumed [Sat, 14 May 2016 14:08:48 +0000 (14:08 +0000)]
Remove dependency on time in favor of std::time

9 years agoReplace references to conduit(-static) with uuid/rand
Carol (Nichols || Goulding) [Sat, 14 May 2016 00:05:38 +0000 (20:05 -0400)]
Replace references to conduit(-static) with uuid/rand

Since they're official rust crates.

9 years agoCombine related thoughts into the same paragraph
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:56:54 +0000 (19:56 -0400)]
Combine related thoughts into the same paragraph

9 years agoReword to not call a non-rust-tuple thing a tuple
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:56:11 +0000 (19:56 -0400)]
Reword to not call a non-rust-tuple thing a tuple

9 years agoUse — instead of --
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:55:07 +0000 (19:55 -0400)]
Use â€” instead of --

9 years agoUse code formatting for `git`
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:54:36 +0000 (19:54 -0400)]
Use code formatting for `git`

9 years agoAdd all three channels to the sample .travis.yml
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:53:19 +0000 (19:53 -0400)]
Add all three channels to the sample .travis.yml

9 years agoReplace refs to color-rs crate to rust-lang's rand crate
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:50:33 +0000 (19:50 -0400)]
Replace refs to color-rs crate to rust-lang's rand crate

Bonus: rand has a `next` branch so the git branch example makes more
sense!

9 years agoClarify that release builds go in the release dir, not another subdir
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:42:40 +0000 (19:42 -0400)]
Clarify that release builds go in the release dir, not another subdir

Good call @steveklabnik! This matches much more nicely with the contrast
to `target/debug`.

9 years agoLink crates.io everywhere
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:42:01 +0000 (19:42 -0400)]
Link crates.io everywhere

9 years agoFix markdown links that repeat their link text unnecessarily
Carol (Nichols || Goulding) [Fri, 13 May 2016 23:40:53 +0000 (19:40 -0400)]
Fix markdown links that repeat their link text unnecessarily

9 years agoUpdate manpage with some missing cargo commands
hatsunearu [Fri, 13 May 2016 22:37:01 +0000 (15:37 -0700)]
Update manpage with some missing cargo commands

9 years agoAdd instructions for rendering docs locally to the README
Carol (Nichols || Goulding) [Fri, 13 May 2016 20:47:11 +0000 (16:47 -0400)]
Add instructions for rendering docs locally to the README

9 years agoMake the crates.io docs about publishing only, not using
Carol (Nichols || Goulding) [Fri, 13 May 2016 20:09:02 +0000 (16:09 -0400)]
Make the crates.io docs about publishing only, not using

Try to make this flow a bit more and have sections based on what
situation you might find yourself in.

9 years agoConsolidate all info about specifying deps into one page.
Carol (Nichols || Goulding) [Fri, 13 May 2016 19:13:36 +0000 (15:13 -0400)]
Consolidate all info about specifying deps into one page.

I think information about specifying dependencies deserves to have its
own page since this info is commonly needed and there are a LOT of
different ways to specify dependencies.

Previously this information was spread across multiple pages, now
there's one place to go if you're looking for any of these ways, rather
than checking the multiple pages this info was spread across before.

9 years agoIncorporate "using crates from crates.io" into the main guide
Carol (Nichols || Goulding) [Fri, 13 May 2016 18:16:39 +0000 (14:16 -0400)]
Incorporate "using crates from crates.io" into the main guide

Connects to rust-lang/cargo#1035. Using crates from crates.io is a
common thing that many people will want to know how to do right away and
deserves to be part of the main guide.

9 years agoMove the Travis CI section under the testing section
Carol (Nichols || Goulding) [Fri, 13 May 2016 18:10:42 +0000 (14:10 -0400)]
Move the Travis CI section under the testing section

I'm guessing the path dependency section got added in between. Also
linked to the Travis CI rust docs and removed the hyphen since Travis CI
seems to spell it without.

9 years agoSmall rewording changes; mostly to clear up potential ambiguity
Carol (Nichols || Goulding) [Fri, 13 May 2016 18:00:46 +0000 (14:00 -0400)]
Small rewording changes; mostly to clear up potential ambiguity

9 years agoCorrect reference to `foo` to `hello_world`
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:39:15 +0000 (12:39 -0400)]
Correct reference to `foo` to `hello_world`

Copypasta, or forgotten name change

9 years agoClarify that the "somewhere" is github
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:34:31 +0000 (12:34 -0400)]
Clarify that the "somewhere" is github

9 years agoMention that binary location changes when using --release
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:31:57 +0000 (12:31 -0400)]
Mention that binary location changes when using --release

9 years agoRemove out of place instructions on passing args and flags
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:27:10 +0000 (12:27 -0400)]
Remove out of place instructions on passing args and flags

This doesn't feel like it fits very well at this point, since our
example program doesn't take args and beginners to cargo probably don't
have a reason to want to pass flags on to rustc at this point. Also it
doesn't even say rustc, just "which flags go where"... where would they
go?!?!

9 years agoCorrect `Fresh` to `Compiling` since we aren't running with -v
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:25:37 +0000 (12:25 -0400)]
Correct `Fresh` to `Compiling` since we aren't running with -v

I only see `Fresh` if I use `cargo run -v`, but this example uses `cargo
run`. Someone following along might not see either of these if they just
built in the previous step, though, so clarify that you'll only see that
if you have made changes.

9 years agoRemove extranneous commas
Carol (Nichols || Goulding) [Fri, 13 May 2016 16:58:26 +0000 (12:58 -0400)]
Remove extranneous commas

Steve and commas, sittin in a tree!

Fixes rust-lang/crates.io#334.

9 years agoAuto merge of #2682 - srinivasreddy:refactor_2, r=alexcrichton
bors [Fri, 13 May 2016 06:06:54 +0000 (23:06 -0700)]
Auto merge of #2682 - srinivasreddy:refactor_2, r=alexcrichton

remove deprecated attr - change connect() to join()

9 years agoFix `cargo test --doc` not testing examples
Mikkel Kroman [Fri, 13 May 2016 05:22:19 +0000 (07:22 +0200)]
Fix `cargo test --doc` not testing examples

9 years agoremove deprecated attr - change connect() to join()
Srinivas Reddy Thatiparthy [Fri, 13 May 2016 00:31:37 +0000 (06:01 +0530)]
remove deprecated attr - change connect() to join()

9 years agoAuto merge of #2681 - alexcrichton:cargo-env-home, r=brson
bors [Fri, 13 May 2016 00:28:15 +0000 (17:28 -0700)]
Auto merge of #2681 - alexcrichton:cargo-env-home, r=brson

Canonicalize CARGO_HOME fallback on Windows

This commit ensures that we always return the same fallback value on Windows
regardless of whichever shell we happen to be run from. We do this by removing
the `$HOME` environment variable which `std::env::home_dir` will inspect to
force it to fall back to the system APIs. If the old directory exists then we
favor that one, but otherwise we favor locations like `C:\Users\$user`

Supercedes and closes #2604

9 years agoCanonicalize CARGO_HOME fallback on Windows
Alex Crichton [Thu, 12 May 2016 22:12:16 +0000 (15:12 -0700)]
Canonicalize CARGO_HOME fallback on Windows

This commit ensures that we always return the same fallback value on Windows
regardless of whichever shell we happen to be run from. We do this by removing
the `$HOME` environment variable which `std::env::home_dir` will inspect to
force it to fall back to the system APIs. If the old directory exists then we
favor that one, but otherwise we favor locations like `C:\Users\$user`

Supercedes and closes #2604

9 years agoremove deprecated function sleep_ms and change it to sleep(Duration::from_millis..)
Srinivas Reddy Thatiparthy [Thu, 12 May 2016 16:52:25 +0000 (22:22 +0530)]
remove deprecated function sleep_ms and change it to sleep(Duration::from_millis..)

9 years agoAuto merge of #2678 - matklad:simplify-tests-2, r=alexcrichton
bors [Thu, 12 May 2016 21:09:45 +0000 (14:09 -0700)]
Auto merge of #2678 - matklad:simplify-tests-2, r=alexcrichton

Simplify more tests

This is the followup of #2670

It contains [one](https://github.com/rust-lang/cargo/commit/28887beee054bfa9b56207667df3f5ae38a8ac6f#diff-ebcf8bfb935037902f135a7c225479b5L322) more or less significant change, everything else is just search/replace.

r? @alexcrichton

9 years agoremove useless formats
Aleksey Kladov [Thu, 12 May 2016 17:06:36 +0000 (20:06 +0300)]
remove useless formats

9 years agosimplify tests
Aleksey Kladov [Thu, 12 May 2016 15:23:53 +0000 (18:23 +0300)]
simplify tests

remove ADDING, REMOVING, DOCTEST, DOWNLOADING, PACKAGING, UPLOADING,
VERIFYING, ARCHIVING, INSTALLING, REPLACING constants

9 years agoAuto merge of #2396 - sbeckeriv:network-retry-1602, r=alexcrichton
bors [Thu, 12 May 2016 18:45:03 +0000 (11:45 -0700)]
Auto merge of #2396 - sbeckeriv:network-retry-1602, r=alexcrichton

Network retry issue 1602

Dearest Reviewer,

This branch resolves #1602 which relates to retrying network
issues automatically. There is a new utility helper for retrying
any network call.

There is a new config called net.retry value in the .cargo.config
file. The default value is 2. The documentation has also been
updated to reflect the new value.

Thanks
Becker

9 years agoNetwork retry issue 1602
Stephen Becker IV [Thu, 12 May 2016 01:34:15 +0000 (18:34 -0700)]
Network retry issue 1602

Dearest Reviewer,

This branch resolves #1602 which relates to retrying network
issues automatically. There is a new utility helper for retrying
any network call.

There is a new config called net.retry value in the .cargo.config
file. The default value is 2. The documentation has also been
updated to reflect the new value.

Thanks
Becker

9 years agoAuto merge of #2674 - alexcrichton:less-third-party-cruft, r=brson
bors [Wed, 11 May 2016 23:31:53 +0000 (16:31 -0700)]
Auto merge of #2674 - alexcrichton:less-third-party-cruft, r=brson

Don't print extra error info for subcommands

Assume they take care of error printing, so just ferry along the exit status if
they fail

Closes #2673

9 years agoDon't print extra error info for subcommands
Alex Crichton [Wed, 11 May 2016 23:27:47 +0000 (16:27 -0700)]
Don't print extra error info for subcommands

Assume they take care of error printing, so just ferry along the exit status if
they fail

Closes #2673

9 years agoAuto merge of #2670 - matklad:simplify-tests, r=alexcrichton
bors [Wed, 11 May 2016 22:13:55 +0000 (15:13 -0700)]
Auto merge of #2670 - matklad:simplify-tests, r=alexcrichton

Simplify tests

@alexcrichton I think there is one bit of tests that could be simplified.

What do you think about writing this

```Rust
test!(simple {
    pkg("foo", "0.0.1");

    assert_that(cargo_process("install").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry file://[..])
[COMPILING] foo v0.0.1 (registry file://[..])
[INSTALLING] {home}[..]bin[..]foo[..]
",
        home = cargo_home().display())));
    assert_that(cargo_home(), has_installed_exe("foo"));

    assert_that(cargo_process("uninstall").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
[REMOVING] {home}[..]bin[..]foo[..]
",
        home = cargo_home().display())));
    assert_that(cargo_home(), is_not(has_installed_exe("foo")));
});
```

instead of this

```Rust
test!(simple {
    pkg("foo", "0.0.1");

    assert_that(cargo_process("install").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
{updating} registry `[..]`
{downloading} foo v0.0.1 (registry file://[..])
{compiling} foo v0.0.1 (registry file://[..])
{installing} {home}[..]bin[..]foo[..]
",
        updating = UPDATING,
        downloading = DOWNLOADING,
        compiling = COMPILING,
        installing = INSTALLING,
        home = cargo_home().display())));
    assert_that(cargo_home(), has_installed_exe("foo"));

    assert_that(cargo_process("uninstall").arg("foo"),
                execs().with_status(0).with_stdout(&format!("\
{removing} {home}[..]bin[..]foo[..]
",
        removing = REMOVING,
        home = cargo_home().display())));
    assert_that(cargo_home(), is_not(has_installed_exe("foo")));
});
```

This PR has a proof of concept implementation of this feature applied to a couple of tests.

r? @alexcrichton

9 years agosimplify tests
Aleksey Kladov [Wed, 11 May 2016 16:55:43 +0000 (19:55 +0300)]
simplify tests

remove RUNNING, COMPILING, ERROR, DOCUMENTING, FRESH and UPDATING
constants

9 years agoAuto merge of #2669 - mbrubeck:dev-dep-doc, r=alexcrichton
bors [Wed, 11 May 2016 06:37:09 +0000 (23:37 -0700)]
Auto merge of #2669 - mbrubeck:dev-dep-doc, r=alexcrichton

Document that dev-dependencies are used when building examples

None

9 years agoSimplify tests
Aleksey Kladov [Tue, 10 May 2016 23:52:02 +0000 (02:52 +0300)]
Simplify tests